<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" />
<link href="../../css/themes/default.css" rel="stylesheet" type="text/css"/>
<link href="../../css/themes/mac_os_x.css" rel="stylesheet" type="text/css"/>
<link href="../../css/themes/alphacube.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../js/prototype.js"></script>
<script type="text/javascript" src="../../js/scriptaculous.js"></script>
<script type="text/javascript" src="../../js/page.js"></script>
<script type="text/javascript" src="../../js/window.js"></script>
<script type="text/javascript" src="../../js/window_effects.js"></script>
<script type="text/javascript">
var win;
var usr_win;
var messages = new Array('', 'Alunno inserito con successo', 'Alunno cancellato con successo', 'Alunno modificato con successo');
function user(id){
    //var newwin = window.open_centered("dettaglio_alunno.php?offset=<?php print $offset ?>&order=<?php print $_REQUEST['order'] ?>&id="+id, "news", 650, 450, "");
    usr_win = new Window({className: "mac_os_x", url: "dettaglio_alunno.php?offset=<?php print $offset ?>&order=<?php print $_REQUEST['order'] ?>&id="+id,  width:650, height:450, zIndex: 100, resizable: true, title: "Filtro alunni", showEffect:Effect.Appear, hideEffect: Effect.Fade, draggable:true, wiredDrag: true});
    usr_win.showCenter(false);
}
    
function filter(order){
    //var newwin = window.open_centered("filter.php?order="+order, "filter", 400, 250, "");
    win = new Window({className: "mac_os_x", url: "filter.php?order="+order,  width:400, height:250, zIndex: 100, resizable: true, title: "Filtro alunni", showEffect:Effect.Appear, hideEffect: Effect.Fade, draggable:true, wiredDrag: true});
	win.showCenter(false);
}
</script>
</head>
<body <?php if(isset($_REQUEST['msg'])){ ?>onload="openInfoDialog(messages[<?php print $_REQUEST['msg'] ?>], 2)"<?php } ?>>
    <div id="header">
		<div class="wrap" style="text-align: center">
			<?php include "../header.php" ?>
		</div>
	</div>
	<div class="wrap">
	<div id="main" style="background-color: #FFFFFF; padding-bottom: 30px; width: 100%">
    <form>
        <table class="admin_table">
            <tr class="admin_title_row" >
                <td colspan="3">Elenco alunni: pagina <?php print $page ?> di <?php print $pagine ?> (estratti <?php print $_SESSION['count_alunni'] ?> alunni) <span style="text-decoration: underline"><?php print $query_label ?></span></td>
            </tr>
            <tr>
                <td style="width: 50%" class="adm_titolo_elenco">Nome e cognome</td>
                <td style="width: 30%" class="adm_titolo_elenco">Login</td>
                <td style="width: 20%" style="text-align: center" class="adm_titolo_elenco">Classe</td>
            </tr>
            <tr class="admin_row">
                <td colspan="3"></td>
            </tr>
            <?php
            $x = 1;
            if($res_user->num_rows > $limit)
                $max = $limit;
            else
                $max = $res_user->num_rows;

            while($user = $res_user->fetch_assoc()){
                if($x > $limit) break;
            ?>
            <tr>
                <td class="admin_row<?php if($x % 2) print(" odd") ?>"><a href="#" onclick="user(<?php print $user['id_alunno'] ?>)"><?php print $user['cognome']." ".$user['nome'] ?></a></td>
                <td class="admin_row<?php if($x % 2) print(" odd") ?>"><?php print $user['username'] ?></td>
                <td class="admin_row _center<?php if($x % 2) print(" odd") ?>"><?php print $user['classe'] ?></td>
            </tr>
            <?php
                $x++;
            }
            include "../../shared/navigate.php";
            ?>
            <tr class="admin_row admin_menu">
                <td colspan="3" align="right">
                	<a href="#" onclick="document.location.href='alunni.php?order=<?php print $new_order ?>'" style="margin-right: 10px"><?php print $button_label ?></a>|
                	<a href="#" onclick="filter('<?php print $current_order ?>')" style="margin-right: 10px; margin-left: 10px">Filtra elenco</a>|
                    <a href="#" onclick="user('0')" style="margin-right: 10px; margin-left: 10px">Nuovo studente</a>|
                    <a href="../index.php" style="margin-left: 10px">Torna menu</a>
                </td>
            </tr>
            <tr>
                <td colspan="3" class="admin_row"></td>
            </tr>
        </table>
        </form>
        </div>
        <div id="footer">
			<p>Design: Luka Cvrk - <a href="http://www.solucija.com" title="Free Web Templates">Solucija</a></p>
		</div>
	</div>
</body>
</html>